]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
system: Always use default avatar in switch-user submenu
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 5 Feb 2019 12:55:14 +0000 (13:55 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Sun, 10 Feb 2019 10:33:23 +0000 (10:33 +0000)
It is too small to be really useful, and sticks out being the
only color icon.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/957

data/theme/gnome-shell-sass/_common.scss
js/ui/status/system.js

index 3eb95331db94f9b6f8538058bffa74f7a07b6693..44bf04ec308c8ce5e5bec98449d3f3aadd3004d8 100644 (file)
@@ -1080,11 +1080,7 @@ StScrollBar {
 
   // a little unstructured mess:
 
-  .system-switch-user-submenu-icon.user-icon {
-    icon-size: 20px;
-    padding: 0 2px;
-  }
-  .system-switch-user-submenu-icon.default-icon {
+  .system-switch-user-submenu-icon {
     icon-size: 16px;
     padding: 0 4px;
   }
index e06f179207d9dafe0b20a417b3a81282744ec87a..701d9db330c8097c7c51b6ebaa62c5ec550d2dd0 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { AccountsService, Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
+const { AccountsService, Clutter, GLib, GObject, Shell, St } = imports.gi;
 
 const BoxPointer = imports.ui.boxpointer;
 const SystemActions = imports.misc.systemActions;
@@ -169,24 +169,6 @@ var Indicator = class extends PanelMenu.SystemIndicator {
         let layout = clutterText.get_layout();
         if (layout.is_ellipsized())
             this._switchUserSubMenu.label.text = this._user.get_user_name();
-
-        let iconFile = this._user.get_icon_file();
-        if (iconFile && !GLib.file_test(iconFile, GLib.FileTest.EXISTS))
-            iconFile = null;
-
-        if (iconFile) {
-            let file = Gio.File.new_for_path(iconFile);
-            let gicon = new Gio.FileIcon({ file: file });
-            this._switchUserSubMenu.icon.gicon = gicon;
-
-            this._switchUserSubMenu.icon.add_style_class_name('user-icon');
-            this._switchUserSubMenu.icon.remove_style_class_name('default-icon');
-        } else {
-            this._switchUserSubMenu.icon.icon_name = 'avatar-default-symbolic';
-
-            this._switchUserSubMenu.icon.add_style_class_name('default-icon');
-            this._switchUserSubMenu.icon.remove_style_class_name('user-icon');
-        }
     }
 
     _createActionButton(iconName, accessibleName) {
@@ -204,7 +186,10 @@ var Indicator = class extends PanelMenu.SystemIndicator {
         let item;
 
         this._switchUserSubMenu = new PopupMenu.PopupSubMenuMenuItem('', true);
-        this._switchUserSubMenu.icon.style_class = 'system-switch-user-submenu-icon';
+        this._switchUserSubMenu.icon.set({
+            icon_name: 'avatar-default-symbolic',
+            style_class: 'system-switch-user-submenu-icon'
+        });
 
         // Since the label of the switch user submenu depends on the width of
         // the popup menu, and we can't easily connect on allocation-changed